<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span id="local-6989586621679058053"><span id="local-6989586621679058054"></span></span><span class="hs-pragma">{-# LANGUAGE DeriveDataTypeable #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE Safe #-}</span><span>
</span><span id="line-3"></span><span>
</span><span id="line-4"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-5"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- Module      :  Text.Parsec.Pos</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- Copyright   :  (c) Daan Leijen 1999-2001, (c) Paolo Martini 2007</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- License     :  BSD-style (see the LICENSE file)</span><span>
</span><span id="line-9"></span><span class="hs-comment">--</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- Maintainer  :  derek.a.elkins@gmail.com</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- Stability   :  provisional</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-13"></span><span class="hs-comment">--</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- Textual source positions.</span><span>
</span><span id="line-15"></span><span class="hs-comment">--</span><span>
</span><span id="line-16"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-17"></span><span>
</span><span id="line-18"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Text.Parsec.Pos</span><span>
</span><span id="line-19"></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourceName"><span class="hs-identifier">SourceName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#Line"><span class="hs-identifier">Line</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#Column"><span class="hs-identifier">Column</span></a></span><span>
</span><span id="line-20"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier">SourcePos</span></a></span><span>
</span><span id="line-21"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#sourceLine"><span class="hs-identifier">sourceLine</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#sourceColumn"><span class="hs-identifier">sourceColumn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#sourceName"><span class="hs-identifier">sourceName</span></a></span><span>
</span><span id="line-22"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#incSourceLine"><span class="hs-identifier">incSourceLine</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#incSourceColumn"><span class="hs-identifier">incSourceColumn</span></a></span><span>
</span><span id="line-23"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#setSourceLine"><span class="hs-identifier">setSourceLine</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#setSourceColumn"><span class="hs-identifier">setSourceColumn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#setSourceName"><span class="hs-identifier">setSourceName</span></a></span><span>
</span><span id="line-24"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#newPos"><span class="hs-identifier">newPos</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#initialPos"><span class="hs-identifier">initialPos</span></a></span><span>
</span><span id="line-25"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#updatePosChar"><span class="hs-identifier">updatePosChar</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#updatePosString"><span class="hs-identifier">updatePosString</span></a></span><span>
</span><span id="line-26"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-27"></span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Data.html#"><span class="hs-identifier">Data.Data</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Data.html#Data"><span class="hs-identifier">Data</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Typeable.html#"><span class="hs-identifier">Data.Typeable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Typeable.Internal.html#Typeable"><span class="hs-identifier">Typeable</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-30"></span><span>
</span><span id="line-31"></span><span class="hs-comment">-- &lt; Source positions: a file name, a line and a column</span><span>
</span><span id="line-32"></span><span class="hs-comment">-- upper left is (1,1)</span><span>
</span><span id="line-33"></span><span>
</span><span id="line-34"></span><span class="hs-keyword">type</span><span> </span><span id="SourceName"><span class="annot"><a href="Text.Parsec.Pos.html#SourceName"><span class="hs-identifier hs-var">SourceName</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-35"></span><span class="hs-keyword">type</span><span> </span><span id="Line"><span class="annot"><a href="Text.Parsec.Pos.html#Line"><span class="hs-identifier hs-var">Line</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-36"></span><span class="hs-keyword">type</span><span> </span><span id="Column"><span class="annot"><a href="Text.Parsec.Pos.html#Column"><span class="hs-identifier hs-var">Column</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-37"></span><span>
</span><span id="line-38"></span><span class="hs-comment">-- | The abstract data type @SourcePos@ represents source positions. It</span><span>
</span><span id="line-39"></span><span class="hs-comment">-- contains the name of the source (i.e. file name), a line number and</span><span>
</span><span id="line-40"></span><span class="hs-comment">-- a column number. @SourcePos@ is an instance of the 'Show', 'Eq' and</span><span>
</span><span id="line-41"></span><span class="hs-comment">-- 'Ord' class.</span><span>
</span><span id="line-42"></span><span>
</span><span id="line-43"></span><span class="hs-keyword">data</span><span> </span><span id="SourcePos"><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-var">SourcePos</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="SourcePos"><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-var">SourcePos</span></a></span></span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourceName"><span class="hs-identifier hs-type">SourceName</span></a></span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="Text.Parsec.Pos.html#Line"><span class="hs-identifier hs-type">Line</span></a></span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="Text.Parsec.Pos.html#Column"><span class="hs-identifier hs-type">Column</span></a></span><span>
</span><span id="line-44"></span><span>    </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span> </span><span id="local-6989586621679058012"><span id="local-6989586621679058020"><span class="annot"><span class="annottext">SourcePos -&gt; SourcePos -&gt; Bool
(SourcePos -&gt; SourcePos -&gt; Bool)
-&gt; (SourcePos -&gt; SourcePos -&gt; Bool) -&gt; Eq SourcePos
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: SourcePos -&gt; SourcePos -&gt; Bool
$c/= :: SourcePos -&gt; SourcePos -&gt; Bool
== :: SourcePos -&gt; SourcePos -&gt; Bool
$c== :: SourcePos -&gt; SourcePos -&gt; Bool
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679057981"><span id="local-6989586621679057983"><span id="local-6989586621679057986"><span id="local-6989586621679057989"><span id="local-6989586621679057992"><span id="local-6989586621679057998"><span id="local-6989586621679058006"><span class="annot"><span class="annottext">Eq SourcePos
Eq SourcePos
-&gt; (SourcePos -&gt; SourcePos -&gt; Ordering)
-&gt; (SourcePos -&gt; SourcePos -&gt; Bool)
-&gt; (SourcePos -&gt; SourcePos -&gt; Bool)
-&gt; (SourcePos -&gt; SourcePos -&gt; Bool)
-&gt; (SourcePos -&gt; SourcePos -&gt; Bool)
-&gt; (SourcePos -&gt; SourcePos -&gt; SourcePos)
-&gt; (SourcePos -&gt; SourcePos -&gt; SourcePos)
-&gt; Ord SourcePos
SourcePos -&gt; SourcePos -&gt; Bool
SourcePos -&gt; SourcePos -&gt; Ordering
SourcePos -&gt; SourcePos -&gt; SourcePos
forall a.
Eq a
-&gt; (a -&gt; a -&gt; Ordering)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; a)
-&gt; (a -&gt; a -&gt; a)
-&gt; Ord a
min :: SourcePos -&gt; SourcePos -&gt; SourcePos
$cmin :: SourcePos -&gt; SourcePos -&gt; SourcePos
max :: SourcePos -&gt; SourcePos -&gt; SourcePos
$cmax :: SourcePos -&gt; SourcePos -&gt; SourcePos
&gt;= :: SourcePos -&gt; SourcePos -&gt; Bool
$c&gt;= :: SourcePos -&gt; SourcePos -&gt; Bool
&gt; :: SourcePos -&gt; SourcePos -&gt; Bool
$c&gt; :: SourcePos -&gt; SourcePos -&gt; Bool
&lt;= :: SourcePos -&gt; SourcePos -&gt; Bool
$c&lt;= :: SourcePos -&gt; SourcePos -&gt; Bool
&lt; :: SourcePos -&gt; SourcePos -&gt; Bool
$c&lt; :: SourcePos -&gt; SourcePos -&gt; Bool
compare :: SourcePos -&gt; SourcePos -&gt; Ordering
$ccompare :: SourcePos -&gt; SourcePos -&gt; Ordering
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Ord</span></span></span></span></span></span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679057939"><span id="local-6989586621679057941"><span id="local-6989586621679057943"><span id="local-6989586621679057945"><span id="local-6989586621679057947"><span id="local-6989586621679057949"><span id="local-6989586621679057951"><span id="local-6989586621679057953"><span id="local-6989586621679057955"><span id="local-6989586621679057957"><span id="local-6989586621679057959"><span id="local-6989586621679057961"><span id="local-6989586621679057967"><span id="local-6989586621679057975"><span class="annot"><span class="annottext">Typeable SourcePos
Typeable SourcePos
-&gt; (forall (c :: * -&gt; *).
    (forall d b. Data d =&gt; c (d -&gt; b) -&gt; d -&gt; c b)
    -&gt; (forall g. g -&gt; c g) -&gt; SourcePos -&gt; c SourcePos)
-&gt; (forall (c :: * -&gt; *).
    (forall b r. Data b =&gt; c (b -&gt; r) -&gt; c r)
    -&gt; (forall r. r -&gt; c r) -&gt; Constr -&gt; c SourcePos)
-&gt; (SourcePos -&gt; Constr)
-&gt; (SourcePos -&gt; DataType)
-&gt; (forall (t :: * -&gt; *) (c :: * -&gt; *).
    Typeable t =&gt;
    (forall d. Data d =&gt; c (t d)) -&gt; Maybe (c SourcePos))
-&gt; (forall (t :: * -&gt; * -&gt; *) (c :: * -&gt; *).
    Typeable t =&gt;
    (forall d e. (Data d, Data e) =&gt; c (t d e)) -&gt; Maybe (c SourcePos))
-&gt; ((forall b. Data b =&gt; b -&gt; b) -&gt; SourcePos -&gt; SourcePos)
-&gt; (forall r r'.
    (r -&gt; r' -&gt; r)
    -&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; SourcePos -&gt; r)
-&gt; (forall r r'.
    (r' -&gt; r -&gt; r)
    -&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; SourcePos -&gt; r)
-&gt; (forall u. (forall d. Data d =&gt; d -&gt; u) -&gt; SourcePos -&gt; [u])
-&gt; (forall u.
    Line -&gt; (forall d. Data d =&gt; d -&gt; u) -&gt; SourcePos -&gt; u)
-&gt; (forall (m :: * -&gt; *).
    Monad m =&gt;
    (forall d. Data d =&gt; d -&gt; m d) -&gt; SourcePos -&gt; m SourcePos)
-&gt; (forall (m :: * -&gt; *).
    MonadPlus m =&gt;
    (forall d. Data d =&gt; d -&gt; m d) -&gt; SourcePos -&gt; m SourcePos)
-&gt; (forall (m :: * -&gt; *).
    MonadPlus m =&gt;
    (forall d. Data d =&gt; d -&gt; m d) -&gt; SourcePos -&gt; m SourcePos)
-&gt; Data SourcePos
SourcePos -&gt; DataType
SourcePos -&gt; Constr
(forall b. Data b =&gt; b -&gt; b) -&gt; SourcePos -&gt; SourcePos
forall a.
Typeable a
-&gt; (forall (c :: * -&gt; *).
    (forall d b. Data d =&gt; c (d -&gt; b) -&gt; d -&gt; c b)
    -&gt; (forall g. g -&gt; c g) -&gt; a -&gt; c a)
-&gt; (forall (c :: * -&gt; *).
    (forall b r. Data b =&gt; c (b -&gt; r) -&gt; c r)
    -&gt; (forall r. r -&gt; c r) -&gt; Constr -&gt; c a)
-&gt; (a -&gt; Constr)
-&gt; (a -&gt; DataType)
-&gt; (forall (t :: * -&gt; *) (c :: * -&gt; *).
    Typeable t =&gt;
    (forall d. Data d =&gt; c (t d)) -&gt; Maybe (c a))
-&gt; (forall (t :: * -&gt; * -&gt; *) (c :: * -&gt; *).
    Typeable t =&gt;
    (forall d e. (Data d, Data e) =&gt; c (t d e)) -&gt; Maybe (c a))
-&gt; ((forall b. Data b =&gt; b -&gt; b) -&gt; a -&gt; a)
-&gt; (forall r r'.
    (r -&gt; r' -&gt; r) -&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; a -&gt; r)
-&gt; (forall r r'.
    (r' -&gt; r -&gt; r) -&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; a -&gt; r)
-&gt; (forall u. (forall d. Data d =&gt; d -&gt; u) -&gt; a -&gt; [u])
-&gt; (forall u. Line -&gt; (forall d. Data d =&gt; d -&gt; u) -&gt; a -&gt; u)
-&gt; (forall (m :: * -&gt; *).
    Monad m =&gt;
    (forall d. Data d =&gt; d -&gt; m d) -&gt; a -&gt; m a)
-&gt; (forall (m :: * -&gt; *).
    MonadPlus m =&gt;
    (forall d. Data d =&gt; d -&gt; m d) -&gt; a -&gt; m a)
-&gt; (forall (m :: * -&gt; *).
    MonadPlus m =&gt;
    (forall d. Data d =&gt; d -&gt; m d) -&gt; a -&gt; m a)
-&gt; Data a
forall u. Line -&gt; (forall d. Data d =&gt; d -&gt; u) -&gt; SourcePos -&gt; u
forall u. (forall d. Data d =&gt; d -&gt; u) -&gt; SourcePos -&gt; [u]
forall r r'.
(r -&gt; r' -&gt; r)
-&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; SourcePos -&gt; r
forall r r'.
(r' -&gt; r -&gt; r)
-&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; SourcePos -&gt; r
forall (m :: * -&gt; *).
Monad m =&gt;
(forall d. Data d =&gt; d -&gt; m d) -&gt; SourcePos -&gt; m SourcePos
forall (m :: * -&gt; *).
MonadPlus m =&gt;
(forall d. Data d =&gt; d -&gt; m d) -&gt; SourcePos -&gt; m SourcePos
forall (c :: * -&gt; *).
(forall b r. Data b =&gt; c (b -&gt; r) -&gt; c r)
-&gt; (forall r. r -&gt; c r) -&gt; Constr -&gt; c SourcePos
forall (c :: * -&gt; *).
(forall d b. Data d =&gt; c (d -&gt; b) -&gt; d -&gt; c b)
-&gt; (forall g. g -&gt; c g) -&gt; SourcePos -&gt; c SourcePos
forall (t :: * -&gt; *) (c :: * -&gt; *).
Typeable t =&gt;
(forall d. Data d =&gt; c (t d)) -&gt; Maybe (c SourcePos)
forall (t :: * -&gt; * -&gt; *) (c :: * -&gt; *).
Typeable t =&gt;
(forall d e. (Data d, Data e) =&gt; c (t d e)) -&gt; Maybe (c SourcePos)
gmapMo :: forall (m :: * -&gt; *).
MonadPlus m =&gt;
(forall d. Data d =&gt; d -&gt; m d) -&gt; SourcePos -&gt; m SourcePos
$cgmapMo :: forall (m :: * -&gt; *).
MonadPlus m =&gt;
(forall d. Data d =&gt; d -&gt; m d) -&gt; SourcePos -&gt; m SourcePos
gmapMp :: forall (m :: * -&gt; *).
MonadPlus m =&gt;
(forall d. Data d =&gt; d -&gt; m d) -&gt; SourcePos -&gt; m SourcePos
$cgmapMp :: forall (m :: * -&gt; *).
MonadPlus m =&gt;
(forall d. Data d =&gt; d -&gt; m d) -&gt; SourcePos -&gt; m SourcePos
gmapM :: forall (m :: * -&gt; *).
Monad m =&gt;
(forall d. Data d =&gt; d -&gt; m d) -&gt; SourcePos -&gt; m SourcePos
$cgmapM :: forall (m :: * -&gt; *).
Monad m =&gt;
(forall d. Data d =&gt; d -&gt; m d) -&gt; SourcePos -&gt; m SourcePos
gmapQi :: forall u. Line -&gt; (forall d. Data d =&gt; d -&gt; u) -&gt; SourcePos -&gt; u
$cgmapQi :: forall u. Line -&gt; (forall d. Data d =&gt; d -&gt; u) -&gt; SourcePos -&gt; u
gmapQ :: forall u. (forall d. Data d =&gt; d -&gt; u) -&gt; SourcePos -&gt; [u]
$cgmapQ :: forall u. (forall d. Data d =&gt; d -&gt; u) -&gt; SourcePos -&gt; [u]
gmapQr :: forall r r'.
(r' -&gt; r -&gt; r)
-&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; SourcePos -&gt; r
$cgmapQr :: forall r r'.
(r' -&gt; r -&gt; r)
-&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; SourcePos -&gt; r
gmapQl :: forall r r'.
(r -&gt; r' -&gt; r)
-&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; SourcePos -&gt; r
$cgmapQl :: forall r r'.
(r -&gt; r' -&gt; r)
-&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; SourcePos -&gt; r
gmapT :: (forall b. Data b =&gt; b -&gt; b) -&gt; SourcePos -&gt; SourcePos
$cgmapT :: (forall b. Data b =&gt; b -&gt; b) -&gt; SourcePos -&gt; SourcePos
dataCast2 :: forall (t :: * -&gt; * -&gt; *) (c :: * -&gt; *).
Typeable t =&gt;
(forall d e. (Data d, Data e) =&gt; c (t d e)) -&gt; Maybe (c SourcePos)
$cdataCast2 :: forall (t :: * -&gt; * -&gt; *) (c :: * -&gt; *).
Typeable t =&gt;
(forall d e. (Data d, Data e) =&gt; c (t d e)) -&gt; Maybe (c SourcePos)
dataCast1 :: forall (t :: * -&gt; *) (c :: * -&gt; *).
Typeable t =&gt;
(forall d. Data d =&gt; c (t d)) -&gt; Maybe (c SourcePos)
$cdataCast1 :: forall (t :: * -&gt; *) (c :: * -&gt; *).
Typeable t =&gt;
(forall d. Data d =&gt; c (t d)) -&gt; Maybe (c SourcePos)
dataTypeOf :: SourcePos -&gt; DataType
$cdataTypeOf :: SourcePos -&gt; DataType
toConstr :: SourcePos -&gt; Constr
$ctoConstr :: SourcePos -&gt; Constr
gunfold :: forall (c :: * -&gt; *).
(forall b r. Data b =&gt; c (b -&gt; r) -&gt; c r)
-&gt; (forall r. r -&gt; c r) -&gt; Constr -&gt; c SourcePos
$cgunfold :: forall (c :: * -&gt; *).
(forall b r. Data b =&gt; c (b -&gt; r) -&gt; c r)
-&gt; (forall r. r -&gt; c r) -&gt; Constr -&gt; c SourcePos
gfoldl :: forall (c :: * -&gt; *).
(forall d b. Data d =&gt; c (d -&gt; b) -&gt; d -&gt; c b)
-&gt; (forall g. g -&gt; c g) -&gt; SourcePos -&gt; c SourcePos
$cgfoldl :: forall (c :: * -&gt; *).
(forall d b. Data d =&gt; c (d -&gt; b) -&gt; d -&gt; c b)
-&gt; (forall g. g -&gt; c g) -&gt; SourcePos -&gt; c SourcePos
</span><a href="../../base/src/Data.Data.html#Data"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Data</span></a></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Typeable.Internal.html#Typeable"><span class="hs-identifier hs-type">Typeable</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-45"></span><span>
</span><span id="line-46"></span><span class="hs-comment">-- | Create a new 'SourcePos' with the given source name,</span><span>
</span><span id="line-47"></span><span class="hs-comment">-- line number and column number.</span><span>
</span><span id="line-48"></span><span>
</span><span id="line-49"></span><span class="annot"><a href="Text.Parsec.Pos.html#newPos"><span class="hs-identifier hs-type">newPos</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourceName"><span class="hs-identifier hs-type">SourceName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#Line"><span class="hs-identifier hs-type">Line</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#Column"><span class="hs-identifier hs-type">Column</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span>
</span><span id="line-50"></span><span id="newPos"><span class="annot"><span class="annottext">newPos :: SourceName -&gt; Line -&gt; Line -&gt; SourcePos
</span><a href="Text.Parsec.Pos.html#newPos"><span class="hs-identifier hs-var hs-var">newPos</span></a></span></span><span> </span><span id="local-6989586621679057936"><span class="annot"><span class="annottext">SourceName
</span><a href="#local-6989586621679057936"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621679057935"><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057935"><span class="hs-identifier hs-var">line</span></a></span></span><span> </span><span id="local-6989586621679057934"><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057934"><span class="hs-identifier hs-var">column</span></a></span></span><span>
</span><span id="line-51"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SourceName -&gt; Line -&gt; Line -&gt; SourcePos
</span><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-var">SourcePos</span></a></span><span> </span><span class="annot"><span class="annottext">SourceName
</span><a href="#local-6989586621679057936"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057935"><span class="hs-identifier hs-var">line</span></a></span><span> </span><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057934"><span class="hs-identifier hs-var">column</span></a></span><span>
</span><span id="line-52"></span><span>
</span><span id="line-53"></span><span class="hs-comment">-- | Create a new 'SourcePos' with the given source name,</span><span>
</span><span id="line-54"></span><span class="hs-comment">-- and line number and column number set to 1, the upper left.</span><span>
</span><span id="line-55"></span><span>
</span><span id="line-56"></span><span class="annot"><a href="Text.Parsec.Pos.html#initialPos"><span class="hs-identifier hs-type">initialPos</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourceName"><span class="hs-identifier hs-type">SourceName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span>
</span><span id="line-57"></span><span id="initialPos"><span class="annot"><span class="annottext">initialPos :: SourceName -&gt; SourcePos
</span><a href="Text.Parsec.Pos.html#initialPos"><span class="hs-identifier hs-var hs-var">initialPos</span></a></span></span><span> </span><span id="local-6989586621679057933"><span class="annot"><span class="annottext">SourceName
</span><a href="#local-6989586621679057933"><span class="hs-identifier hs-var">name</span></a></span></span><span>
</span><span id="line-58"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SourceName -&gt; Line -&gt; Line -&gt; SourcePos
</span><a href="Text.Parsec.Pos.html#newPos"><span class="hs-identifier hs-var">newPos</span></a></span><span> </span><span class="annot"><span class="annottext">SourceName
</span><a href="#local-6989586621679057933"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Line
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">Line
</span><span class="hs-number">1</span></span><span>
</span><span id="line-59"></span><span>
</span><span id="line-60"></span><span class="hs-comment">-- | Extracts the name of the source from a source position.</span><span>
</span><span id="line-61"></span><span>
</span><span id="line-62"></span><span class="annot"><a href="Text.Parsec.Pos.html#sourceName"><span class="hs-identifier hs-type">sourceName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourceName"><span class="hs-identifier hs-type">SourceName</span></a></span><span>
</span><span id="line-63"></span><span id="sourceName"><span class="annot"><span class="annottext">sourceName :: SourcePos -&gt; SourceName
</span><a href="Text.Parsec.Pos.html#sourceName"><span class="hs-identifier hs-var hs-var">sourceName</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span> </span><span id="local-6989586621679057932"><span class="annot"><span class="annottext">SourceName
</span><a href="#local-6989586621679057932"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621679057931"><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057931"><span class="hs-identifier hs-var">_line</span></a></span></span><span> </span><span id="local-6989586621679057930"><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057930"><span class="hs-identifier hs-var">_column</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SourceName
</span><a href="#local-6989586621679057932"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-64"></span><span>
</span><span id="line-65"></span><span class="hs-comment">-- | Extracts the line number from a source position.</span><span>
</span><span id="line-66"></span><span>
</span><span id="line-67"></span><span class="annot"><a href="Text.Parsec.Pos.html#sourceLine"><span class="hs-identifier hs-type">sourceLine</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#Line"><span class="hs-identifier hs-type">Line</span></a></span><span>
</span><span id="line-68"></span><span id="sourceLine"><span class="annot"><span class="annottext">sourceLine :: SourcePos -&gt; Line
</span><a href="Text.Parsec.Pos.html#sourceLine"><span class="hs-identifier hs-var hs-var">sourceLine</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span> </span><span id="local-6989586621679057929"><span class="annot"><span class="annottext">SourceName
</span><a href="#local-6989586621679057929"><span class="hs-identifier hs-var">_name</span></a></span></span><span> </span><span id="local-6989586621679057928"><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057928"><span class="hs-identifier hs-var">line</span></a></span></span><span> </span><span id="local-6989586621679057927"><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057927"><span class="hs-identifier hs-var">_column</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057928"><span class="hs-identifier hs-var">line</span></a></span><span>
</span><span id="line-69"></span><span>
</span><span id="line-70"></span><span class="hs-comment">-- | Extracts the column number from a source position.</span><span>
</span><span id="line-71"></span><span>
</span><span id="line-72"></span><span class="annot"><a href="Text.Parsec.Pos.html#sourceColumn"><span class="hs-identifier hs-type">sourceColumn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#Column"><span class="hs-identifier hs-type">Column</span></a></span><span>
</span><span id="line-73"></span><span id="sourceColumn"><span class="annot"><span class="annottext">sourceColumn :: SourcePos -&gt; Line
</span><a href="Text.Parsec.Pos.html#sourceColumn"><span class="hs-identifier hs-var hs-var">sourceColumn</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span> </span><span id="local-6989586621679057926"><span class="annot"><span class="annottext">SourceName
</span><a href="#local-6989586621679057926"><span class="hs-identifier hs-var">_name</span></a></span></span><span> </span><span id="local-6989586621679057925"><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057925"><span class="hs-identifier hs-var">_line</span></a></span></span><span> </span><span id="local-6989586621679057924"><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057924"><span class="hs-identifier hs-var">column</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057924"><span class="hs-identifier hs-var">column</span></a></span><span>
</span><span id="line-74"></span><span>
</span><span id="line-75"></span><span class="hs-comment">-- | Increments the line number of a source position.</span><span>
</span><span id="line-76"></span><span>
</span><span id="line-77"></span><span class="annot"><a href="Text.Parsec.Pos.html#incSourceLine"><span class="hs-identifier hs-type">incSourceLine</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#Line"><span class="hs-identifier hs-type">Line</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span>
</span><span id="line-78"></span><span id="incSourceLine"><span class="annot"><span class="annottext">incSourceLine :: SourcePos -&gt; Line -&gt; SourcePos
</span><a href="Text.Parsec.Pos.html#incSourceLine"><span class="hs-identifier hs-var hs-var">incSourceLine</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span> </span><span id="local-6989586621679057923"><span class="annot"><span class="annottext">SourceName
</span><a href="#local-6989586621679057923"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621679057922"><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057922"><span class="hs-identifier hs-var">line</span></a></span></span><span> </span><span id="local-6989586621679057921"><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057921"><span class="hs-identifier hs-var">column</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679057920"><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057920"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SourceName -&gt; Line -&gt; Line -&gt; SourcePos
</span><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-var">SourcePos</span></a></span><span> </span><span class="annot"><span class="annottext">SourceName
</span><a href="#local-6989586621679057923"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057922"><span class="hs-identifier hs-var">line</span></a></span><span class="annot"><span class="annottext">Line -&gt; Line -&gt; Line
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057920"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057921"><span class="hs-identifier hs-var">column</span></a></span><span>
</span><span id="line-79"></span><span>
</span><span id="line-80"></span><span class="hs-comment">-- | Increments the column number of a source position.</span><span>
</span><span id="line-81"></span><span>
</span><span id="line-82"></span><span class="annot"><a href="Text.Parsec.Pos.html#incSourceColumn"><span class="hs-identifier hs-type">incSourceColumn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#Column"><span class="hs-identifier hs-type">Column</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span>
</span><span id="line-83"></span><span id="incSourceColumn"><span class="annot"><span class="annottext">incSourceColumn :: SourcePos -&gt; Line -&gt; SourcePos
</span><a href="Text.Parsec.Pos.html#incSourceColumn"><span class="hs-identifier hs-var hs-var">incSourceColumn</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span> </span><span id="local-6989586621679057918"><span class="annot"><span class="annottext">SourceName
</span><a href="#local-6989586621679057918"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621679057917"><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057917"><span class="hs-identifier hs-var">line</span></a></span></span><span> </span><span id="local-6989586621679057916"><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057916"><span class="hs-identifier hs-var">column</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679057915"><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057915"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SourceName -&gt; Line -&gt; Line -&gt; SourcePos
</span><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-var">SourcePos</span></a></span><span> </span><span class="annot"><span class="annottext">SourceName
</span><a href="#local-6989586621679057918"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057917"><span class="hs-identifier hs-var">line</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057916"><span class="hs-identifier hs-var">column</span></a></span><span class="annot"><span class="annottext">Line -&gt; Line -&gt; Line
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057915"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-84"></span><span>
</span><span id="line-85"></span><span class="hs-comment">-- | Set the name of the source.</span><span>
</span><span id="line-86"></span><span>
</span><span id="line-87"></span><span class="annot"><a href="Text.Parsec.Pos.html#setSourceName"><span class="hs-identifier hs-type">setSourceName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourceName"><span class="hs-identifier hs-type">SourceName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span>
</span><span id="line-88"></span><span id="setSourceName"><span class="annot"><span class="annottext">setSourceName :: SourcePos -&gt; SourceName -&gt; SourcePos
</span><a href="Text.Parsec.Pos.html#setSourceName"><span class="hs-identifier hs-var hs-var">setSourceName</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span> </span><span id="local-6989586621679057914"><span class="annot"><span class="annottext">SourceName
</span><a href="#local-6989586621679057914"><span class="hs-identifier hs-var">_name</span></a></span></span><span> </span><span id="local-6989586621679057913"><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057913"><span class="hs-identifier hs-var">line</span></a></span></span><span> </span><span id="local-6989586621679057912"><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057912"><span class="hs-identifier hs-var">column</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679057911"><span class="annot"><span class="annottext">SourceName
</span><a href="#local-6989586621679057911"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SourceName -&gt; Line -&gt; Line -&gt; SourcePos
</span><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-var">SourcePos</span></a></span><span> </span><span class="annot"><span class="annottext">SourceName
</span><a href="#local-6989586621679057911"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057913"><span class="hs-identifier hs-var">line</span></a></span><span> </span><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057912"><span class="hs-identifier hs-var">column</span></a></span><span>
</span><span id="line-89"></span><span>
</span><span id="line-90"></span><span class="hs-comment">-- | Set the line number of a source position.</span><span>
</span><span id="line-91"></span><span>
</span><span id="line-92"></span><span class="annot"><a href="Text.Parsec.Pos.html#setSourceLine"><span class="hs-identifier hs-type">setSourceLine</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#Line"><span class="hs-identifier hs-type">Line</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span>
</span><span id="line-93"></span><span id="setSourceLine"><span class="annot"><span class="annottext">setSourceLine :: SourcePos -&gt; Line -&gt; SourcePos
</span><a href="Text.Parsec.Pos.html#setSourceLine"><span class="hs-identifier hs-var hs-var">setSourceLine</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span> </span><span id="local-6989586621679057910"><span class="annot"><span class="annottext">SourceName
</span><a href="#local-6989586621679057910"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621679057909"><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057909"><span class="hs-identifier hs-var">_line</span></a></span></span><span> </span><span id="local-6989586621679057908"><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057908"><span class="hs-identifier hs-var">column</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679057907"><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057907"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SourceName -&gt; Line -&gt; Line -&gt; SourcePos
</span><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-var">SourcePos</span></a></span><span> </span><span class="annot"><span class="annottext">SourceName
</span><a href="#local-6989586621679057910"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057907"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057908"><span class="hs-identifier hs-var">column</span></a></span><span>
</span><span id="line-94"></span><span>
</span><span id="line-95"></span><span class="hs-comment">-- | Set the column number of a source position.</span><span>
</span><span id="line-96"></span><span>
</span><span id="line-97"></span><span class="annot"><a href="Text.Parsec.Pos.html#setSourceColumn"><span class="hs-identifier hs-type">setSourceColumn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#Column"><span class="hs-identifier hs-type">Column</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span>
</span><span id="line-98"></span><span id="setSourceColumn"><span class="annot"><span class="annottext">setSourceColumn :: SourcePos -&gt; Line -&gt; SourcePos
</span><a href="Text.Parsec.Pos.html#setSourceColumn"><span class="hs-identifier hs-var hs-var">setSourceColumn</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span> </span><span id="local-6989586621679057906"><span class="annot"><span class="annottext">SourceName
</span><a href="#local-6989586621679057906"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621679057905"><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057905"><span class="hs-identifier hs-var">line</span></a></span></span><span> </span><span id="local-6989586621679057904"><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057904"><span class="hs-identifier hs-var">_column</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679057903"><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057903"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SourceName -&gt; Line -&gt; Line -&gt; SourcePos
</span><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-var">SourcePos</span></a></span><span> </span><span class="annot"><span class="annottext">SourceName
</span><a href="#local-6989586621679057906"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057905"><span class="hs-identifier hs-var">line</span></a></span><span> </span><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057903"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-99"></span><span>
</span><span id="line-100"></span><span class="hs-comment">-- | The expression @updatePosString pos s@ updates the source position</span><span>
</span><span id="line-101"></span><span class="hs-comment">-- @pos@ by calling 'updatePosChar' on every character in @s@, ie.</span><span>
</span><span id="line-102"></span><span class="hs-comment">-- @foldl updatePosChar pos string@.</span><span>
</span><span id="line-103"></span><span>
</span><span id="line-104"></span><span class="annot"><a href="Text.Parsec.Pos.html#updatePosString"><span class="hs-identifier hs-type">updatePosString</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span>
</span><span id="line-105"></span><span id="updatePosString"><span class="annot"><span class="annottext">updatePosString :: SourcePos -&gt; SourceName -&gt; SourcePos
</span><a href="Text.Parsec.Pos.html#updatePosString"><span class="hs-identifier hs-var hs-var">updatePosString</span></a></span></span><span> </span><span id="local-6989586621679057902"><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679057902"><span class="hs-identifier hs-var">pos</span></a></span></span><span> </span><span id="local-6989586621679057901"><span class="annot"><span class="annottext">SourceName
</span><a href="#local-6989586621679057901"><span class="hs-identifier hs-var">string</span></a></span></span><span>
</span><span id="line-106"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(SourcePos -&gt; Char -&gt; SourcePos)
-&gt; SourcePos -&gt; SourceName -&gt; SourcePos
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl"><span class="hs-identifier hs-var">foldl</span></a></span><span> </span><span class="annot"><span class="annottext">SourcePos -&gt; Char -&gt; SourcePos
</span><a href="Text.Parsec.Pos.html#updatePosChar"><span class="hs-identifier hs-var">updatePosChar</span></a></span><span> </span><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679057902"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">SourceName
</span><a href="#local-6989586621679057901"><span class="hs-identifier hs-var">string</span></a></span><span>
</span><span id="line-107"></span><span>
</span><span id="line-108"></span><span class="hs-comment">-- | Update a source position given a character. If the character is a</span><span>
</span><span id="line-109"></span><span class="hs-comment">-- newline (\'\\n\') or carriage return (\'\\r\') the line number is</span><span>
</span><span id="line-110"></span><span class="hs-comment">-- incremented by 1. If the character is a tab (\'\t\') the column</span><span>
</span><span id="line-111"></span><span class="hs-comment">-- number is incremented to the nearest 8'th column, ie. @column + 8 -</span><span>
</span><span id="line-112"></span><span class="hs-comment">-- ((column-1) \`mod\` 8)@. In all other cases, the column is</span><span>
</span><span id="line-113"></span><span class="hs-comment">-- incremented by 1.</span><span>
</span><span id="line-114"></span><span>
</span><span id="line-115"></span><span class="annot"><a href="Text.Parsec.Pos.html#updatePosChar"><span class="hs-identifier hs-type">updatePosChar</span></a></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span>
</span><span id="line-116"></span><span id="updatePosChar"><span class="annot"><span class="annottext">updatePosChar :: SourcePos -&gt; Char -&gt; SourcePos
</span><a href="Text.Parsec.Pos.html#updatePosChar"><span class="hs-identifier hs-var hs-var">updatePosChar</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span> </span><span id="local-6989586621679057899"><span class="annot"><span class="annottext">SourceName
</span><a href="#local-6989586621679057899"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621679057898"><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057898"><span class="hs-identifier hs-var">line</span></a></span></span><span> </span><span id="local-6989586621679057897"><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057897"><span class="hs-identifier hs-var">column</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679057896"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679057896"><span class="hs-identifier hs-var">c</span></a></span></span><span>
</span><span id="line-117"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679057896"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-118"></span><span>        </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\n'</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">SourceName -&gt; Line -&gt; Line -&gt; SourcePos
</span><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-var">SourcePos</span></a></span><span> </span><span class="annot"><span class="annottext">SourceName
</span><a href="#local-6989586621679057899"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057898"><span class="hs-identifier hs-var">line</span></a></span><span class="annot"><span class="annottext">Line -&gt; Line -&gt; Line
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Line
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Line
</span><span class="hs-number">1</span></span><span>
</span><span id="line-119"></span><span>        </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\t'</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">SourceName -&gt; Line -&gt; Line -&gt; SourcePos
</span><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-var">SourcePos</span></a></span><span> </span><span class="annot"><span class="annottext">SourceName
</span><a href="#local-6989586621679057899"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057898"><span class="hs-identifier hs-var">line</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057897"><span class="hs-identifier hs-var">column</span></a></span><span> </span><span class="annot"><span class="annottext">Line -&gt; Line -&gt; Line
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Line
</span><span class="hs-number">8</span></span><span> </span><span class="annot"><span class="annottext">Line -&gt; Line -&gt; Line
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057897"><span class="hs-identifier hs-var">column</span></a></span><span class="annot"><span class="annottext">Line -&gt; Line -&gt; Line
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Line
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Line -&gt; Line -&gt; Line
forall a. Integral a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Real.html#mod"><span class="hs-operator hs-var">`mod`</span></a></span><span> </span><span class="annot"><span class="annottext">Line
</span><span class="hs-number">8</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-120"></span><span>        </span><span class="annot"><span class="annottext">Char
</span><span class="hs-identifier">_</span></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">SourceName -&gt; Line -&gt; Line -&gt; SourcePos
</span><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-var">SourcePos</span></a></span><span> </span><span class="annot"><span class="annottext">SourceName
</span><a href="#local-6989586621679057899"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057898"><span class="hs-identifier hs-var">line</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057897"><span class="hs-identifier hs-var">column</span></a></span><span> </span><span class="annot"><span class="annottext">Line -&gt; Line -&gt; Line
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Line
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-121"></span><span>
</span><span id="line-122"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679057890"><span id="local-6989586621679057893"><span class="annot"><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-123"></span><span>  </span><span id="local-6989586621679057887"><span class="annot"><span class="annottext">show :: SourcePos -&gt; SourceName
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var hs-var hs-var hs-var">show</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span> </span><span id="local-6989586621679057885"><span class="annot"><span class="annottext">SourceName
</span><a href="#local-6989586621679057885"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621679057884"><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057884"><span class="hs-identifier hs-var">line</span></a></span></span><span> </span><span id="local-6989586621679057883"><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057883"><span class="hs-identifier hs-var">column</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-124"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">SourceName -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">SourceName
</span><a href="#local-6989586621679057885"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SourceName
</span><a href="#local-6989586621679057881"><span class="hs-identifier hs-var">showLineColumn</span></a></span><span>
</span><span id="line-125"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SourceName
</span><span class="hs-string">&quot;\&quot;&quot;</span></span><span> </span><span class="annot"><span class="annottext">SourceName -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">SourceName
</span><a href="#local-6989586621679057885"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">SourceName -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">SourceName
</span><span class="hs-string">&quot;\&quot; &quot;</span></span><span> </span><span class="annot"><span class="annottext">SourceName -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">SourceName
</span><a href="#local-6989586621679057881"><span class="hs-identifier hs-var">showLineColumn</span></a></span><span>
</span><span id="line-126"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-127"></span><span>      </span><span id="local-6989586621679057881"><span class="annot"><span class="annottext">showLineColumn :: SourceName
</span><a href="#local-6989586621679057881"><span class="hs-identifier hs-var hs-var">showLineColumn</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SourceName
</span><span class="hs-string">&quot;(line &quot;</span></span><span> </span><span class="annot"><span class="annottext">SourceName -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Line -&gt; SourceName
forall a. Show a =&gt; a -&gt; SourceName
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057884"><span class="hs-identifier hs-var">line</span></a></span><span> </span><span class="annot"><span class="annottext">SourceName -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-128"></span><span>                          </span><span class="annot"><span class="annottext">SourceName
</span><span class="hs-string">&quot;, column &quot;</span></span><span> </span><span class="annot"><span class="annottext">SourceName -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Line -&gt; SourceName
forall a. Show a =&gt; a -&gt; SourceName
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Line
</span><a href="#local-6989586621679057883"><span class="hs-identifier hs-var">column</span></a></span><span> </span><span class="annot"><span class="annottext">SourceName -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-129"></span><span>                          </span><span class="annot"><span class="annottext">SourceName
</span><span class="hs-string">&quot;)&quot;</span></span><span>
</span><span id="line-130"></span></pre></body></html>